package com.eastfair.imaster.dto;

import com.eastfair.imaster.enumeration.BusinResourceCorrelationTypeEnum;
import com.eastfair.imaster.enumeration.BusinResourceResourceTypeEnum;
import com.eastfair.imaster.enumeration.BusinResourceStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 实体类
 * 业务资源表
 * </p>
 *
 * @author ligang
 * @since 2022-01-20
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "BusinResourceDTO", description = "业务资源表")
public class BusinResourceDTO implements Serializable {
    public interface saveNews {
    }

    public interface saveVideo {
    }

    public interface saveData {
    }

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
//    @NotNull(groups = {BulletScreenDTO.VerifyUpdate.class})
    private Long id;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    private Long projectId;
    /**
     * 关联身份#{user:用户;exhibitor:展商;project:项目;sponsor:主办}
     */
    @ApiModelProperty(value = "关联身份#{user:用户;exhibitor:展商;project:项目;sponsor:主办}")
    @NotNull(groups = {saveNews.class,saveVideo.class,saveData.class}, message = "关联身份不能为空")
    private BusinResourceCorrelationTypeEnum correlationType;

    /**
     * 资源类型#{news:新闻;video:视频}
     */
    @ApiModelProperty(value = "资源类型#{news:新闻;video:视频}")
    private BusinResourceResourceTypeEnum resourceType;

    /**
     * 关联ID
     */
    @ApiModelProperty(value = "关联ID")
    @NotNull(groups = {saveNews.class,saveVideo.class,saveData.class}, message = "关联ID不能为空")
    private Long correlationId;

    /**
     * 资源标题
     */
    @ApiModelProperty(value = "资源标题")
    @NotBlank(groups = {saveNews.class,saveVideo.class}, message = "资源标题不能为空")
    private String title;

    /**
     * 富文本
     */
    @ApiModelProperty(value = "富文本")
    @NotBlank(groups = {saveNews.class}, message = "富文本不能为空")
    private String richText;
    /**
     * 附属业务--新闻
     */
    @ApiModelProperty(value = "附属业务--新闻")
    @NotNull(groups = {saveNews.class}, message = "附属业务--新闻 不能为空")
    private ResourceOfNew resourceOfNew;

    /**
     * 附属业务--资料
     */
    @ApiModelProperty(value = "附属业务--资料")
    @NotNull(groups = {saveData.class}, message = "附属业务-资料 不能为空")
    private List<ResourceOfFile> resourceOfFileList;

    /**
     * 附属业务--视频
     */
    @ApiModelProperty(value = "附属业务--视频")
//    @NotNull(groups = {saveVideo.class}, message = "附属业务-视频 不能为空")
    private List<ResourceOfVideo> resourceOfVideoList;



    /**
     * 文件地址，单个文件
     */
    @ApiModelProperty(value = "文件地址")
    @Size(max = 1024, message = "文件地址，单个文件长度不能超过1024")
//    @NotBlank(groups = {saveData.class,saveVideo.class}, message = "文件地址不能为空")
    private String url;
    /**
     * 状态 #{normal:正常;wait_init:待初始化;forbidden:禁用;waiting:待审核;refuse:拒绝}
     */
    @ApiModelProperty(value = "状态 #{normal:正常;wait_init:待初始化;forbidden:禁用;waiting:待审核;refuse:拒绝}")
    private BusinResourceStatusEnum status;
    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer sequence;
    /**
     * 是否生效(默认1：可用 0:不可用)
     */
    @ApiModelProperty(value = "是否生效(默认1：可用 0:不可用)")
    private Integer isEnable;
    /**
     * 是否删除(默认0：未删除1:已删除)
     */
    @ApiModelProperty(value = "是否删除(默认0：未删除1:已删除)")
    private Integer isDeleted;

    /**
     * 主键id集合
     */
    @ApiModelProperty(value = "主键id集合")
    private List<Long> ids;

    /**
     * 审核是否通过
     */
    @ApiModelProperty(value = "审核是否通过 true通过 false不通过")
    private Boolean isCheck;

    /**
     * 是否上下架 1是 0否
     */
    @ApiModelProperty(value = "是否上下架 1是 0否")
    private Integer isShelves;

    /**
     * 前端用视频数组
     */
    @NotNull(groups = {saveVideo.class}, message = "前端用视频数组 不能为空")
    private String advertsVideo;
    /**
     * 前端用视频封面图数组
     */
    @NotNull(groups = {saveVideo.class}, message = "前端用视频封面图数组 不能为空")
    private String advertsVideoImage;

    /**
     * 前端用视频简介
     */
    @NotNull(groups = {saveVideo.class}, message = "前端用视频简介 不能为空")
    private String videoText;
}
